<template>
    <div class="searchBar">
        <div class="navBar">
            <ul>
                <li :class="props.activeIndex == 0 ? 'active' : ''" @click="changeNav(0)">
                    <span>值班排班</span>
                </li>
                <li :class="props.activeIndex == 1 ? 'active' : ''" @click="changeNav(1)">
                    <span>日常管理</span>
                </li>
            </ul>
        </div>
        <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
            <el-tab-pane label="电力班组" name="first"></el-tab-pane>
            <el-tab-pane label="锅炉班组" name="second"></el-tab-pane>
            <el-tab-pane label="汽机班组" name="third"></el-tab-pane>
        </el-tabs>
        <div class="content">
            <div class="left">
                <el-form class="form" :model="searchData.params"  label-position="left">
                    <el-form-item label="月份">
                        <el-date-picker v-model="searchData.params.year" type="month" placeholder="请选择月份" />
                    </el-form-item>
                    <el-form-item label="班组成员姓名">
                        <el-input v-model="searchData.params.name" placeholder="班组成员姓名"></el-input>
                    </el-form-item>
                    <el-form-item label="日期">
                        <el-date-picker v-model="date" type="daterange" range-separator="-"
                            start-placeholder="开始日期" end-placeholder="结束日期"  />
                    </el-form-item>
                </el-form>
            </div>
            <div class="right">
                <div class="btn_bg" title="搜索" @click="searchList">
                    <img class="btn_icon search_icon" src="@/assets/images/images_new/search_icon.png" alt="">
                </div>
                <div class="btn_bg btn_bg2" title="清空" @click="empty">
                        <img class="btn_icon reset_icon" src="@/assets/images/images_new/reset_icon.png" alt="">
                    </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">

const props = defineProps({
    activeIndex: {
        type: Number,
        default: 0
    }
})

const activeName = ref('first')

let date = ref('');//日期范围

const handleClick = (tab: any, event: Event) => {
    console.log(tab, event)
}

let searchData = reactive({
    params: {
        year: "",//年份
        standOut: 1,//突出显示
        name: ""
    } as any
})


let emit = defineEmits(['changeNav'])

const changeNav = (index: number) => {
    if (props.activeIndex != index) {
        emit('changeNav', index)
    }

}

//查找
const searchList = () => {

}

//清空
const empty = ()=>{

}
</script>

<style lang="scss" scoped>
.searchBar {
    background-color: #fff;
    border-radius: 0px 0px 8px 8px;
    padding: 28px 0px 20px 30px;

    .navBar {
        ul {
            // width: 320px;
            display: flex;
            // border: 1px solid rgb(229, 229, 229);

            li {
                width: 160px;
                height: 38px;
                font-size: 16px;
                font-weight: 400;
                letter-spacing: 0px;
                line-height: 36px;
                // color: rgba(0, 0, 0, 1);
                color: rgb(112, 105, 95);
                text-align: center;
                cursor: pointer;
                position: relative;
                border-top: 1px solid rgb(229, 229, 229);
                border-bottom: 1px solid rgb(229, 229, 229);
                border-right: 1px solid rgb(229, 229, 229);

                &:first-child {
                    border-left: 1px solid rgb(229, 229, 229);
                }

                &.active {
                    width: 160px;
                    font-size: 16px;
                    line-height: 36px;
                    color: rgba(0, 0, 0, 1);
                    background: rgb(229, 229, 229);
                }
            }

        }
    }

    .content {
        padding-top: 26px;
        display: flex;
        padding-left: 8px;
        padding-right: 35px;

        .left {
            flex: 1;
            min-width: 0;
            .el-form {
                .el-form-item {
                    padding-right: 50px;
                    max-width: 33.33%;
                    .el-radio-group {
                        .el-radio {
                            margin-right: 20px;
                        }
                    }
                }
            }
        }

        .right {
                width: 87px;
                height: 32px;
                flex-shrink: 0;
                display: flex;
                justify-content: flex-start;
                align-items: center;
                .btn_bg {

                    height: 35px;
                    width: 35px;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                        cursor: pointer;

                    &:hover {
                        background: rgba(0, 0, 0, 0.1);
                        border-radius: 2px;
                    }

                    &.btn_bg2 {
                        margin-left: 17px;
                    }

                    .search_icon {
                        width: 21px;
                        cursor: pointer;
                    }

                    .reset_icon {
                        width: 20px;
                        cursor: pointer;
                    }
                }


            }
    }
}

// :deep(.el-date-editor--month) {
//     border: none !important;
// }

:deep(.el-tabs) {
    background-color: #fff;

    .el-tabs__header {
        margin: 0;
    }

    .el-tabs__nav-scroll {
        padding-left: 30px;
    }

    .el-tabs__nav-wrap {
        &::after {
            height: 1px;
        }
    }

    .el-tabs__active-bar {
        height: 1px;
        background-color: rgb(192, 164, 91);
    }

    .el-tabs__item {
        &.is-active {
            color: rgb(192, 164, 91);
        }

        &:hover {
            color: rgb(192, 164, 91);
        }
    }
}
</style>
